﻿using System;
using UnityEngine;

// Token: 0x0200014A RID: 330
[AddComponentMenu("RVP/C#/Suspension/Suspension Property", 2)]
[DisallowMultipleComponent]
[RequireComponent(typeof(Suspension))]
public class SuspensionPropertyToggle : MonoBehaviour
{
	// Token: 0x060005F6 RID: 1526 RVA: 0x000308A5 File Offset: 0x0002EAA5
	private void Start()
	{
		this.sus = base.GetComponent<Suspension>();
	}

	// Token: 0x060005F7 RID: 1527 RVA: 0x000308B4 File Offset: 0x0002EAB4
	public void ToggleProperty(int index)
	{
		if (this.properties.Length - 1 >= index)
		{
			this.properties[index].toggled = !this.properties[index].toggled;
			if (this.sus)
			{
				this.sus.UpdateProperties();
			}
		}
	}

	// Token: 0x060005F8 RID: 1528 RVA: 0x00030909 File Offset: 0x0002EB09
	public void SetProperty(int index, bool value)
	{
		if (this.properties.Length - 1 >= index)
		{
			this.properties[index].toggled = value;
			if (this.sus)
			{
				this.sus.UpdateProperties();
			}
		}
	}

	// Token: 0x0400092B RID: 2347
	public SuspensionToggledProperty[] properties;

	// Token: 0x0400092C RID: 2348
	private Suspension sus;
}
